VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmACR500 
   BackColor       =   &H00800000&
   Caption         =   "ACR500"
   ClientHeight    =   6225
   ClientLeft      =   435
   ClientTop       =   1410
   ClientWidth     =   10890
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   6225
   ScaleWidth      =   10890
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   330
      Left            =   8550
      Top             =   45
      Visible         =   0   'False
      Width           =   2025
      _ExtentX        =   3572
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "4.ACRLine"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton cmdReview 
      Caption         =   "&Review ACR"
      Height          =   456
      Left            =   270
      TabIndex        =   40
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      Height          =   456
      Left            =   7080
      TabIndex        =   39
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Height          =   456
      Left            =   5940
      TabIndex        =   38
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "&Save"
      Height          =   456
      Left            =   4815
      TabIndex        =   37
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdAddNew 
      Caption         =   "New &ACR"
      Height          =   456
      Left            =   1410
      TabIndex        =   36
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdNewItem 
      Caption         =   "New &line"
      Height          =   456
      Left            =   2550
      TabIndex        =   35
      Top             =   5580
      Width           =   1128
   End
   Begin VB.CommandButton cmdEdit 
      Caption         =   "&Edit"
      Height          =   456
      Left            =   3690
      TabIndex        =   34
      Top             =   5580
      Width           =   1128
   End
   Begin VB.Frame FrameACRLine 
      BackColor       =   &H00800000&
      BorderStyle     =   0  'None
      Caption         =   "Frame2"
      Height          =   1950
      Left            =   60
      TabIndex        =   30
      Top             =   3435
      Width           =   10695
      Begin MSDataGridLib.DataGrid grdACR 
         Bindings        =   "frmACR500.frx":0000
         Height          =   1575
         Left            =   195
         TabIndex        =   31
         Top             =   345
         Width           =   10395
         _ExtentX        =   18336
         _ExtentY        =   2778
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   8
         BeginProperty Column00 
            DataField       =   "ARRFD"
            Caption         =   "Ref Doc"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "ARDOC"
            Caption         =   "Doc"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "BHAMT"
            Caption         =   "Total Amt"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "ARAMT"
            Caption         =   "Payment"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "ARBAL"
            Caption         =   "Balance"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "BHBAM"
            Caption         =   "Base Amt"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column06 
            DataField       =   "ARBAM"
            Caption         =   "Base Payment"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column07 
            DataField       =   "ARBBL"
            Caption         =   "Base Balance"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1036
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               ColumnWidth     =   14.74
            EndProperty
            BeginProperty Column01 
            EndProperty
            BeginProperty Column02 
               ColumnWidth     =   1349.858
            EndProperty
            BeginProperty Column03 
               ColumnWidth     =   1260.284
            EndProperty
            BeginProperty Column04 
               ColumnWidth     =   1230.236
            EndProperty
            BeginProperty Column05 
               ColumnWidth     =   1365.165
            EndProperty
            BeginProperty Column06 
               ColumnWidth     =   1454.74
            EndProperty
            BeginProperty Column07 
            EndProperty
         EndProperty
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "ACR line No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   5
         Left            =   60
         TabIndex        =   41
         Top             =   45
         Width           =   1110
      End
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   6570
      Top             =   30
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "3.CCM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame FrameLine 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   1275
      Left            =   195
      TabIndex        =   15
      Top             =   2085
      Width           =   10440
      Begin VB.TextBox txtARBAM 
         Height          =   315
         Left            =   1905
         TabIndex        =   33
         Top             =   435
         Width           =   1320
      End
      Begin VB.TextBox txtARBBL 
         Height          =   315
         Left            =   8655
         TabIndex        =   28
         Top             =   480
         Width           =   1320
      End
      Begin VB.TextBox txtARBAM1 
         Height          =   315
         Left            =   5220
         TabIndex        =   27
         Top             =   540
         Width           =   1320
      End
      Begin VB.TextBox txtARBAL 
         Height          =   315
         Left            =   8685
         TabIndex        =   26
         Top             =   885
         Width           =   1320
      End
      Begin VB.TextBox txtARAMT1 
         Height          =   315
         Left            =   5205
         TabIndex        =   25
         Top             =   885
         Width           =   1320
      End
      Begin VB.TextBox txtARAMT 
         Height          =   315
         Left            =   1905
         TabIndex        =   24
         Top             =   870
         Width           =   1320
      End
      Begin MSDataListLib.DataCombo cboARRFD 
         Bindings        =   "frmACR500.frx":0015
         Height          =   315
         Left            =   1890
         TabIndex        =   23
         Top             =   15
         Width           =   1650
         _ExtentX        =   2910
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "ARRFD"
         Text            =   ""
      End
      Begin VB.TextBox txtARRFD 
         Height          =   300
         Left            =   1890
         TabIndex        =   22
         Top             =   30
         Width           =   1365
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Base payment"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   14
         Left            =   525
         TabIndex        =   32
         Top             =   525
         Width           =   1260
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Base Balance"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   13
         Left            =   7425
         TabIndex        =   21
         Top             =   540
         Width           =   1215
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Base Total"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   12
         Left            =   4065
         TabIndex        =   20
         Top             =   600
         Width           =   990
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Balance(VND)"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   11
         Left            =   7440
         TabIndex        =   19
         Top             =   960
         Width           =   1230
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Total(VND)"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   10
         Left            =   4080
         TabIndex        =   18
         Top             =   1005
         Width           =   1005
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Payment"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   4
         Left            =   555
         TabIndex        =   17
         Top             =   885
         Width           =   855
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Ref No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   3
         Left            =   540
         TabIndex        =   16
         Top             =   120
         Width           =   615
      End
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   4530
      Top             =   30
      Visible         =   0   'False
      Width           =   1860
      _ExtentX        =   3281
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "2.ACR"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   2580
      Top             =   15
      Visible         =   0   'False
      Width           =   1875
      _ExtentX        =   3307
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "1.RCM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame FrameARC 
      BackColor       =   &H00800000&
      BorderStyle     =   0  'None
      Caption         =   "Frame2"
      Height          =   990
      Left            =   150
      TabIndex        =   2
      Top             =   1020
      Width           =   10395
      Begin MSDataListLib.DataCombo cboARCCD 
         Height          =   315
         Left            =   5940
         TabIndex        =   29
         Top             =   600
         Visible         =   0   'False
         Width           =   1500
         _ExtentX        =   2646
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo cboARCNO 
         Bindings        =   "frmACR500.frx":002A
         Height          =   315
         Left            =   1305
         TabIndex        =   14
         Top             =   585
         Visible         =   0   'False
         Width           =   3090
         _ExtentX        =   5450
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "CMNME"
         BoundColumn     =   "CMCNO"
         Text            =   ""
      End
      Begin VB.TextBox txtCMNME 
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   2145
         TabIndex        =   8
         Top             =   600
         Width           =   2235
      End
      Begin VB.TextBox txtARCER 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   9045
         TabIndex        =   7
         Top             =   630
         Width           =   1170
      End
      Begin VB.TextBox txtARCNO 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1305
         TabIndex        =   6
         Top             =   600
         Width           =   750
      End
      Begin VB.TextBox txtARDTE 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   5940
         TabIndex        =   5
         Top             =   180
         Width           =   1200
      End
      Begin VB.TextBox txtARDOC 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1305
         Locked          =   -1  'True
         TabIndex        =   4
         Top             =   225
         Width           =   1215
      End
      Begin VB.TextBox txtARCCD 
         Height          =   315
         Left            =   5955
         TabIndex        =   3
         Top             =   600
         Width           =   1215
      End
      Begin VB.Line Line1 
         X1              =   2160
         X2              =   5340
         Y1              =   5280
         Y2              =   4455
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "DocNo"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   2
         Left            =   570
         TabIndex        =   13
         Top             =   270
         Width           =   615
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Customer No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   6
         Left            =   15
         TabIndex        =   12
         Top             =   660
         Width           =   1170
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Date"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   33
         Left            =   5385
         TabIndex        =   11
         Top             =   210
         Width           =   480
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Currency Code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   34
         Left            =   4590
         TabIndex        =   10
         Top             =   660
         Width           =   1320
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Exchange rate"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   7
         Left            =   7725
         TabIndex        =   9
         Top             =   660
         Width           =   1305
      End
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "ACR500"
      BeginProperty Font 
         Name            =   "VNI-Present"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   480
      Index           =   0
      Left            =   105
      TabIndex        =   1
      Top             =   0
      Width           =   1800
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Account Receivable Entry"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   540
      Index           =   1
      Left            =   1995
      TabIndex        =   0
      Top             =   345
      Width           =   5535
   End
End
Attribute VB_Name = "frmACR500"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim NewTrans As Byte



Private Sub cboARCCD_Click(Area As Integer)
If Area = 2 Then
    txtARCCD = CboARCCD.Text
    CboARCCD.Visible = False
    Dim RecCCI As Recordset
    Set RecCCI = DBconn.Execute("Select * from CCI where CICCD='" & txtARCCD & _
    "' order by CIDTE DESC")
    If Not RecCCI.EOF Then
        txtARCER = RecCCI!CICCR
    Else
        txtARCER = 0
    End If
End If
End Sub

Private Sub cboARCNO_Click(Area As Integer)
If Area = 2 Then
    txtARCNO = cboARCNO.BoundText
    txtCMNME = cboARCNO.Text
    cboARCNO.Visible = False
    txtARCCD.SetFocus
    Adodc2.Refresh
End If
End Sub

Private Sub cmdAddnew_Click()
NewTrans = True
ISEDITING = True
ISADDING = True
WriteToScreen
ButtonStatus
End Sub

Private Sub cmdCancel_Click()
NewTrans = False
ISADDING = False
ISEDITING = False
ButtonStatus
End Sub

Private Sub cmdEdit_Click()
ISEDITING = True
'ISADDING = True
WriteToScreen
ButtonStatus

End Sub

Private Sub cmdexit_Click()
Unload frmACR500
End Sub

Private Sub cmdNewItem_Click()
ISEDITING = True
ISADDING = True
WriteToScreen
ButtonStatus
End Sub

Private Sub cmdReview_Click()
frmReview.Tag = "ACR500"
frmReview.Show 1
ISEDITING = False
ISADDING = False
If frmReview.Tag <> "" Then
    txtARDOC = frmReview.GridList.Columns(1)
    txtARRFD = frmReview.GridList.Columns(2)
    Unload frmReview
    'txtBLLNE = 1
    WriteToScreen
End If
End Sub

Private Sub cmdSave_Click()
WriteToFile
ISADDING = False
ISEDITING = False
NewTrans = False
ButtonStatus
End Sub

Private Sub Form_Load()
OpenFile
End Sub



Private Sub grdACR_Click()
    txtARRFD = grdBBL.Columns(1).value
    txtARDOC = grdBBL.Columns(0).value
    WriteToScreen
    Adodc4.Recordset.AbsolutePosition = SELECTROW
    ISADDING = False
    ISEDITING = False
    ButtonStatus
End Sub

Private Sub grdACR_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
SELECTROW = Adodc4.Recordset.Bookmark
End Sub

Private Sub txtARBAM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If KeyAscii = 13 Then
        txtARAMT = Val(txtARBAM) * Val(txtARCER)
        txtARAMT.SetFocus
        CalculateACR
    End If
End If
End Sub

Private Sub txtARCCD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim Result As String
    Result = Find("CCM", "CMCCD", "WHERE CMCCD='" & txtARCCD & "'")
    If Result <> "" Then
        Dim RecCCI As Recordset
        Set RecCCI = DBconn.Execute("Select * from CCI where CICCD='" & txtARCCD & "' order by CIDTE DESC")
        If Not RecCCI.EOF Then
            txtARCER = RecCCI!CICCR
        Else
            txtARCER = 0
        End If
        txtARCER.SetFocus
    Else
        CboARCCD.Visible = True
        CboARCCD.SetFocus
    End If
End If

End Sub

Private Sub txtARCNO_KeyPress(KeyAscii As Integer)
Dim Result As String
If KeyAscii = 13 Then
    Result = Find("RCM", "CMNME", "WHERE CMCNO='" & txtARCNO & "'")
    If Result = "" Then
        cboARCNO.Visible = True
        cboARCNO.SetFocus
    Else
        cboARCNO.Visible = False
        txtCMNME = Result
        txtARCCD.SetFocus
        Adodc2.Refresh
    End If
End If
End Sub
Sub OpenFile()
Adodc1.ConnectionString = ConnectString
Adodc1.ConnectionTimeout = 10
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from RCM"
Adodc1.Refresh

Adodc2.ConnectionString = ConnectString
Adodc2.ConnectionTimeout = 10
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "SELECT ACR.* From ACR WHERE (ARDOC = ARRFD) AND (ARCNO='" & txtARCNO & "')"
Adodc2.Refresh

Adodc3.ConnectionString = ConnectString
Adodc3.ConnectionTimeout = 10
Adodc3.CommandType = adCmdText
sql = "Select * from CCM"
Adodc3.RecordSource = sql
Adodc3.Refresh

Adodc4.ConnectionString = ConnectString
Adodc4.ConnectionTimeout = 10
Adodc4.CommandType = adCmdText
Adodc4.RecordSource = "SELECT ACR.* From ACR WHERE (ARDOC <> ARRFD)" & _
" and (ARDOC='" & txtARDOC & "') ORDER BY ARRFD"
Adodc4.Refresh

End Sub
Sub WriteToFile()
If IsDate(txtARDTE) Then txtARDTE = Format(txtARDTE, "yyyy-mm-dd hh:mm:ss")

If ISADDING Then
    txtARDOC = TakeOrderNumberACN("CNNPN", True)
    sql = "Insert Into ACR (ARDOC,ARDTE,ARCNO,ARCCD,ARCER" & _
    ",ARRFD,ARBAM,ARAMT,ARBBL,ARBAL) values " & _
    "('" & txtARDOC & "','" & txtARDTE & "','" & txtARCNO & "','" & txtARCCD & "'," & txtARCER & _
    ",'" & txtARRFD & "'," & txtARBAM & "," & txtARAMT & "," & txtARBBL & "," & txtARBAL & ")"
Else
    sql = "UPDATE ACR SET ARDOC='" & txtARDOC & "', ARRFD='" & txtARRFD & "',ARDTE='" & txtARDTE & "',ARCNO='" & txtARCNO & "',ARCCD='" & txtARCCD & "',ARCER=" & txtARCER & _
    ",ARRFD='" & txtARRFD & "',ARBAM=" & txtARBAM & ",ARAMT=" & txtARAMT & ",ARBBL=" & txtARBBL & ",ARBAL=" & txtARBAL & _
    " where  ARDOC='" & txtARDOC & "' and ARRFD='" & txtARRFD & "'"
End If
DBconn.Execute (sql)

Adodc4.RecordSource = "Select ACR.* from ACR " & _
    "  WHERE ARRFD='" & txtARRFD & "'"
Adodc4.Refresh
End Sub
Sub WriteToScreen()
If NewTrans Then
    txtARDOC = ""
    txtARDTE = WorkingDate
    txtARCNO = ""
    txtCMNME = ""
    txtARCCD = ""
    txtARCER = ""
    CboARCCD = ""
End If
cboARRFD.Visible = False
If ISADDING Then
'    txtARRFD = ""
'    cboARRFD = ""
    txtARBAM = 0
    txtARAMT = 0
    txtARBBL = 0
    txtARBAL = 0
Else
    Dim RecACR As Recordset
    Set RecACR = DBconn.Execute("Select * from ACR where ARDOC='" & txtARDOC & "' AND ARRFD='" & txtARRFD & "'")
    With RecACR
        txtARDOC = !ARDOC
        txtARDTE = !ARDTE
        txtARCNO = !ARCNO
        txtCMNME = Find("RCM", "CMNME", " WHERE CMCNO='" & txtARCNO & "'")
        txtARCCD = !ARCCD
        txtARCER = !ARCER
        CboARCCD = !ARCCD
        txtARRFD = !ARRFD
        
        txtARBAM = !ARBAM
        txtARAMT = !ARAMT
        txtARBBL = !ARBBL
        txtARBAL = !ARBAL
    End With
End If

Adodc4.RecordSource = "Select ACR.* from ACR " & _
    "  WHERE  ARRFD='" & txtARRFD & "'"
Adodc4.Refresh
End Sub

Sub ButtonStatus()
cmdAddNew.Enabled = Not ISEDITING
cmdReview.Enabled = Not ISEDITING
cmdNewItem.Enabled = Not ISEDITING
cmdEdit.Enabled = Not ISEDITING
cmdSave.Enabled = ISEDITING
cmdCancel.Enabled = ISEDITING
FrameARC.Enabled = NewTrans
FrameLine.Enabled = ISEDITING
FrameACRLine.Enabled = ISEDITING
End Sub

Private Sub txtARRFD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Result = Find("ACR", "ARRFD", " WHERE (ARDOC = ARRFD) AND (ARCNO='" & txtARCNO & "')")
    If Result = "" Then
        MsgBox "Khong co so Ref No nay"
        cboARRFD.Visible = True
        cboARRFD.SetFocus
    Else
        txtARBAM.SetFocus
    End If
End If
End Sub
Sub CalculateACR()
Dim recACRTotal, recACRPayment As Recordset, Payment, PaymentBase
Set recACRTotal = DBconn.Execute("Select * from ACR where ARDOC='" & txtARDOC & "'")

If Not recACRTotal.EOF Then
    txtARBAM1 = recACRTotal!ARBAM
    txtARAMT1 = recACRTotal!ARAMT
End If
Set recACRPayment = DBconn.Execute("Select * from ACR where ARRFD='" & txtARDOC & _
"' AND ARRFD<>ARDOC AND ARDOC<" & txtARDOC)
Payment = 0
PaymentBase = 0
With recACRPayment
    Do While Not .EOF
        Payment = Payment + !ARAMT
        PaymentBase = PaymentBase + !ARBAM
        .MoveNext
    Loop
    .Close
End With

txtARBBL = Val(txtARBAM1) - PaymentBase - Val(txtARBAM)
txtARBAL = Val(txtARAMT1) - Payment - Val(txtARAMT)
End Sub
